extends "../calxsm_1_1/calxsm_1_1.gd"
func _init():
	pass
func _extInit():
	._extInit()
	chaName = "夏小尘"
	lv = 4
	addSkillTxt("[color=#FFFF00][血腥杀戮][/color][color=#FFCC22]血腥舞动攻击敌方单体，造成280%神秘系物理伤害并吸取目标20%物攻的体力值\n若目标体力值低于50%，则此技能暴击，击杀被<追猎>的目标时，则刷新90%的CD[CD:18][/color]")   
	addCdSkill("xxsl",18)  


var sx = 0
func _castCdSkill(id):
	._castCdSkill(id)
	if id == "xxsl":
		var b:Buff = aiCha.hasBuff("zhuilie")
		var dmg1 = att.atk*2.8
		var txt = "血腥杀戮"
		if aiCha.att.hp < aiCha.att.maxHp * 0.5:
			txt = "斩·" + txt
			dmg1 = att.atk*(2+att.criR)*2
		var eff1 = sys.newEff("numHit", position, false, 1)
		eff1.setText(txt, "#FF0099")
		eff1.anim.set_speed_scale(0.2)
		typeHurtCha(aiCha,dmg1,Chara.HurtType.PHY,Chara.AtkType.SKILL)
		aiCha.plusHp(-aiCha.att.atk*0.2)
		plusHp(aiCha.att.atk*0.2)
		if b != null:
			sx = 1
			yield(reTimer(0.5),"timeout")
			sx = 0

func _onBattleStart():
	._onBattleStart()
	sx = 0

func _onKillChara(atkInfo):
	._onKillChara(atkInfo)
	if sx == 1:
		sx = 0
		var sk = getSkill("xxsl") 
		sk.nowTime += sk.cd * 0.9